/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.cxhd.lis.util;

import com.cxhd.lis.DataCache;
import com.jfinal.plugin.activerecord.Record;
import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author 52461
 */
public class CacheTool {

    private static DataCache dc = DataCache.getIntance();

    public static void saveAuthToCache(String user_pk, List<Record> list) {

        List<String> listAuth = new ArrayList<String>();

        for (Record re : list) {
            listAuth.add(re.get("url") + "");
        }
        dc.setUserAuth(user_pk, listAuth);

    }

    public static void saveAllAuth(List<Record> list) {
        List<String> listAllAuth = new ArrayList<String>();

        for (Record re : list) {
            listAllAuth.add(re.get("url") + "");
        }
        dc.setAllAuth(listAllAuth);
    }
}
